package com.sixbro.common.domain;

import lombok.Getter;

/**
 * <p>
 *
 * </p>
 *
 * @author: Mr.Lu
 * @since: 2021/11/2 15:05
 */
@Getter
public enum Scope {
    SMS( "sms" ),
    WeChatWeb( "wechat-web" ),
    WeChatMobile( "wechat-mobile" ),
    WeChatMiniProgram( "wechat-mini-program" ),
    QQ( "qq" ),
    Alipay( "alipay" ),
    DingTalkWeb( "ding-talk-web" ),
    DingTalkMiniProgram( "ding-talk-mini-program" ),
    Email( "email" ),
    Apple( "apple" );
    public final String id;

    Scope( String id ) {
        this.id = id;
    }

    public boolean shouldConnectSMS( ) {
        return this == SMS;
    }

    public boolean shouldConnectWeChatMobileAndWeb( ) {
        return this == WeChatMobile || this == WeChatWeb;
    }

    public boolean shouldConnectWeChatMiniProgram( ) {
        return this == WeChatMiniProgram;
    }

    public boolean shouldConnectQQ( ) {
        return this == QQ;
    }

    public boolean shouldConnectAlipay( ) {
        return this == Alipay;
    }

    public boolean shouldConnectEmail( ) {
        return this == Email;
    }

    public boolean shouldConnectDingTalk( ) {
        return this == DingTalkWeb || this == DingTalkMiniProgram;
    }

    public boolean shouldConnectApple( ) {
        return this == Apple;
    }
}